<?php
$file_name = "../ptnhuan-web1/data/films.txt";
$file_path=realpath($file_name);
$fimls=array();
 //var_dump($file_path);
//doc file
$file =  fopen($file_path,"r");
//var_dump(file)
while(!feof($file)){
    $films[]=trim(fgets($file));  
}
//var_dump($films);
//dong file
fclose($file);
?>
<?php foreach ($films as $line):?>
    <?php if (!empty($line)):?>

<?php        $films = explode(";", $line);?>

<img src="public/Images/films/<?php echo $films[1]?>">
    <?php echo $films[2];?>
<?php echo $films[3];?><br>

<?php endif;?>
<?php endforeach;?>